<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>无标题文档</title>
    <link href="<%=path%>/css/style.css" rel="stylesheet" type="text/css"/>

    <script type="text/javascript" src="<%=path%>/js/jquery.min.js"></script>
    <script type="text/javascript">

        function deletes(id) {
            window.location.href = "<%=basePath%>deleteDepartment?departid=" + id;
        }

        function modify(id) {
            window.location.href = "<%=basePath%>getDepartmentId?departid=" + id;
        }
    </script>
    <style type="text/css">
        body {
            background: #FFF
        }
    </style>
</head>

<body>
<div id="contentWrap">
    <!--表格控件 -->
    <div id="widget table-widget">
        <div class="pageTitle">科室管理</div>
        <div class="querybody">
            <form action="<%=basePath%>findSomeDepartment" method="post">
                <ul class="seachform">
                    <li><label>科室ID</label><input name="departid" type="text" class="scinput"/></li>
                    <li><label>科室名称</label><input name="name" type="text" class="scinput"/></li>
                    <li><label>&nbsp;</label><input name="" type="submit" class="scbtn" value="查询"/></li>
                </ul>
            </form>
        </div>
        <div class="pageColumn">
            <div class="pageButton"><a href="<%=path%>/html/ksadd.jsp"><img src="<%=path%>/images/t01.png"
                                                                            title="新增"/></a><span>科室列表</span>
            </div>
            <table>
                <thead>
                <th width="">科室ID</th>
                <th width="">科室名称</th>
                <th width="">修改人员</th>
                <th width="">添加日期</th>
                <th width="10%">操作</th>
                </thead>
                <tbody>
                <c:forEach items="${departments}" var="depart">
                    <tr>
                        <td>${depart.departId}</td>
                        <td>${depart.name}</td>
                        <td>${depart.userName}</td>
                        <td><fmt:formatDate value="${depart.createDate}" pattern="yyyy-MM-dd"/></td>
                        <td>
                            <a onclick="modify(${depart.departId})"><img src="<%=path%>/images/icon/edit.png" width="16"
                                                                         height="16"/></a>
                            <a onclick="deletes(${depart.departId})"><img src="<%=path%>/images/icon/del.png" width="16"
                                                                          height="16"/></a>
                        </td>
                    </tr>
                </c:forEach>

                </tbody>
            </table>
        </div>
    </div><!-- #widget -->
</div>
</body>
</html>

